use volo_http::{
    server::route::get,
    PathParams, Router,
};

async fn index_handler() -> &'static str {
    "It Works!\n"
}

pub fn example_router() -> Router {
    Router::new().route("/", get(index_handler))
}

async fn foo_handler() -> &'static str {
    "Hello, World!\n"
}

pub fn test_router() -> Router {
    Router::new().route("/foo", get(foo_handler).post(foo_handler))
}

async fn param_handler(PathParams(path): PathParams<String>) -> String {
    path
}

pub fn param_router() -> Router {
    Router::new().route("/user/{*path}", get(param_handler))
}
